<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <input type="text" v-model='a' /><br>
        <input type='text' v-model='b' /><br>
        <input type="button" value="计算" v-on:click='handle'><br> 计算结果：
        <span v-text='result'></span>

    </div>
    <script type="text/javascript" src="../vue.js"></script>
    <script type="text/javascript">
        var vm = new Vue({
            el: '#app',
            data: {
                a: '',
                b: '',
                result: ''
            },
            methods: {
                handle: function() {
                    this.result = parseInt(this.a) + parseInt(this.b);
                }
            }
        })
    </script>
</body>

</html>